package proj.common;

import java.io.IOException;
import java.util.Properties;

public class Config {
	private static Properties p = new Properties();
	static {
		try {
			p.load(Config.class.getClassLoader().getResourceAsStream("config.properties"));
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
	}

	public static String getIp() {
		return p.getProperty("ip");
	}

	public static int getPort() {
		String str = p.getProperty("port");
		if (str == null)
			return 8888;

		return Integer.parseInt(str);
	}

	private Config() {
	}

}
